dwc_otg: make nak_holdoff work as intended with empty queues
authorP33M <p33m@github.com>
Thu, 27 Apr 2017 15:24:34 +0000 (16:24 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:37:10 +0000 (17:37 +0000)
commitd236454231b57c196b913dd85dd8f0fc4a25b7ad
treed528a67eda229b55c5cd029b0a5d57971a5e4e48
parent769ac03b9a2a4599cd6a0d1067dc1a5cad53fbe1
dwc_otg: make nak_holdoff work as intended with empty queues

If URBs reading from non-periodic split endpoints were dequeued and
the last transfer from the endpoint was a NAK handshake, the resulting
qh->nak_frame value was stale which would result in unnecessarily long
polling intervals for the first subsequent transfer with a fresh URB.

Fixup qh->nak_frame in dwc_otg_hcd_urb_dequeue and also guard against
a case where a single URB is submitted to the endpoint, a NAK was
received on the transfer immediately prior to receiving data and the
device subsequently resubmits another URB past the qh->nak_frame interval.

Fixes https://github.com/raspberrypi/linux/issues/1709
drivers/usb/host/dwc_otg/dwc_otg_hcd.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c